package sample.util;

import java.io.*;

/**
 * @author ：five03
 * @description：TODO
 * @date ：2020/8/13 8:12 下午
 */
public class DataSave {
    public static void writeChattingRecords(String content) {
        FileOutputStream o = null;
        File file = new File("src/main/resources/ChattingRecords.txt");

        try {
            o = new FileOutputStream(file,true);
            o.write(content.getBytes("UTF-8"));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (o != null) {
                try {
                    o.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
